<?php
  define('QTY',1000);
  define('COLS',5);
  $rows = ceil( QTY / COLS );
  $count =1;
$t1 = microtime();
$m1 = memory_get_usage();
//echo 'Hello'.'World';
//echo 'Hello World';
echo 'Hello ', 'World';

$table = '<table align="center"  border="1" width="80%">';
$table .='<thead>';
$table .='<tr>';
$table .='<th colspan="'.COLS.'">Table Heading</th>';
$table .='</tr>';
$table .='  </thead>

  <tbody>';


 for($i=1 ; $i<=$rows ; $i++) {
      $color = $i % 2 == 0 ? 'yellow':'lightgreen';

$table .= '<tr>';
       for ($j = 1; $j <= COLS ; $j++) {

        if($count <= QTY){
$table .=
        '<td style="background:'.$color.'">'.$count++.'</td>';
       } else {// end if()
$table .=
        '<td style="background:'.$color.'">&nbsp;</td>';

        }//end else
      }// end for for $j
$table .= '</tr>';
    }// end for for $i
$table .= '</tbody>

</table>';

echo "<br><br>";
 $m2 = memory_get_usage();
echo $m2 - $m1;

echo $table;
unset($table);
echo "<br><br>";
echo microtime() - $t1;
echo "<br><br>";
echo memory_get_usage() - $m2 ;
